Docker 管理工具 (1) Rancher Server主機調度

主機調度用於當Rancher Server管理多台Rancher Agent時,若新增應用要在指定的Rancher Agent中創建就需要定義主機標籤。

  1. 設置主機標籤

name=ubuntuDocker

確認主機已設置好標籤

  1. 指定主機創建應用

使用方法:

1
2
3
labels:
io.rancher.scheduler.global: 'true'
io.rancher.scheduler.affinity:host_label: name=DockerHost

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
version: '2'
services:
ipython2215:
image: ipython/notebook
environment:
PASSWORD: '123456'
USE_HTTP: '1'
stdin_open: true
tty: true
ports:
- 2215:8888/tcp
labels:
io.rancher.scheduler.affinity:host_label: name=DockerHost
io.rancher.scheduler.global: 'true'
  1. 構建完成